﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;

namespace VitCode.BaseDataPageCreator
{
    public class UrlHelper
    {
        public static string GetHttpHeadPath()
        {
            var reVal = "";
            if(HttpContext.Current != null && HttpContext.Current.Request != null)
            {
                var rq = HttpContext.Current.Request;
                reVal = rq.Url.Scheme + "://" + rq.Url.Host;
                if (rq.Url.Port != 80)
                    reVal = reVal + ":" + rq.Url.Port;
                reVal = reVal + rq.ApplicationPath;
            }
            return reVal;
        }
    }
}
